/**
 * 
 */
package cn.sundat.web;

import javax.annotation.Resource;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

import cn.sundat.model.Contacts;
import cn.sundat.service.ContactsService;

/**
 * @author XIN
 *
 */
public class ContactAction extends ActionSupport implements ModelDriven<Contacts>{
	
	@Resource(name="contactsService")
	private ContactsService contactsService;
	Contacts contact=new Contacts();
	@Override
	public Contacts getModel() {
		// TODO Auto-generated method stub
		return contact;
	}
	public String contactAdd() throws Exception {
		// TODO Auto-generated method stub
		contact.setName("张三");
		contactsService.addContact(contact);
		return NONE;
	}

}
